home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
3DDEMO.ZIP
/
3D
/
SOURCE
/
TIMER.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-21
|
544b
|
36 lines
#include "timer.hpp"
// Copyright (c) 1996 by Kerrigan Burgess, all rights reserved.
// Quick and dirty timer.
long Start;
long Clicks;
long TimerQuery(void)
{
long *clock = (long *)0x0000046CL;
return (*clock);
}
void WaitFor(long clicks)
{
Start = TimerQuery();
while ((TimerQuery()-Start)< clicks);
}
void SetTimer(long clicks)
{
Clicks = clicks;
Start = TimerQuery();
}
int Timer(void)
{
if ( (TimerQuery()-Start) < Clicks )
return (1);
else
return (0);
}